import java.util.*;

public class Main {
    public static void main(String[] args) {
        List<Employee> employees = new ArrayList<>();

        //write your code here......
        Employee ming = new Employee("小明", 2500);
        Employee jun = new Employee("小军", 8000);
        Employee hong = new Employee("小红", 100000);

        employees.add(ming);
        employees.add(jun);
        employees.add(hong);

        // 遍历集合计算他们的个人所得税
        for (Employee man : employees) {
            func(man);
        }

    }

    public static void func(Employee man) {
        double salary = man.getSalary();
        int c = 3500;
        double tmp = salary - c;
        double ret = 0;
        if (tmp >= 0 && tmp <= 1500) {
            ret = tmp * 0.03;
        }else if (tmp > 1500 && tmp <= 4500) {
            ret = tmp * 0.1 - 105;
        } else if (tmp > 4500 && tmp <= 9000) {
            ret = tmp * 0.2 - 555;
        } else if (tmp > 9000 && tmp <= 35000) {
            ret = tmp * 0.25 - 1005;
        } else if (tmp > 35000 && tmp <= 55000) {
            ret = tmp * 0.3 - 2755;
        } else if (tmp > 55000 && tmp <= 80000) {
            ret = tmp * 0.35 - 5505;
        } else if (tmp > 80000) {
            ret = tmp * 0.45 - 13505;
        } else {
            ret = 0.0;
        }
        System.out.printf("%s应该缴纳的个人所得税是: %.1f\n", man.getName(), ret);
    }
}
class Employee{
    private String name;
    private double salary;
    public Employee(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }
    public String getName() {
        return name;
    }

    public double getSalary() {
        return salary;
    }
}